package com.liufei.springaiquick.controller;

import jakarta.annotation.Resource;
import org.springframework.ai.deepseek.DeepSeekChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ai")
public class ChatController {


    @Resource
    DeepSeekChatModel chatModel;

    @GetMapping("/chat")
    public String chat(@RequestParam(value = "message") String message) {
        System.out.println("message: " + message);
        String resp = chatModel.call(message);
        System.out.println("resp: " + resp);
        return resp;
    }
}
